<?php
/**
 * theme : default
 * description : fullwidth-content
 * author : Gmax
 */
// pagination
$nbrParPage = 2;
$page = (isset($_GET)&&isset($_GET['p']))?$_GET['p']:0;
?>
<div id="content" class="container">
    <div class="columns sixteen">
        <?php echo $this->getBreadcrumb(' | '); ?>
        <section>
    <?php if($this->getTargetType() ==='category'): ?>
        <?php if($this->getNombrePublications(2,true)>0): ?>
            <h1 class="title"><?php echo $this->translate($this->getTarget(),'title',$this->getLangueCode()); ?></h1>
            <?php foreach($this->getPublications($page*$nbrParPage,$nbrParPage,true,true) as $order=>$publication){
            include('component/interface/post.php');
            } ?>
    <?php

    $nbrPage = 0;
    $nbrArticle = $this->getNombrePublications(0,true);
    if($nbrArticle>$nbrParPage){
        $nbrPage = ceil($nbrArticle/$nbrParPage);
            include('component/interface/pagination.php');
    }
    ?>

        <?php else: ?>
            aucune publication
        <?php endif; ?>
    <?php else: ?>
        <?php
        $publication = $this->getTarget();
        include('component/interface/single.php');
        include('component/interface/prevnext.php');
        ?>
    <?php endif; ?>
        </section>
    </div>
</div>